#include "fontlistmodel.h"

#include <QApplication>

FontListModel::FontListModel(QObject *parent) : QStandardItemModel(parent)
{
    m_title = "";
    m_contentCn = "你们这些家伙，就不会写个字体预览工具?";
    m_contentEn = "You guys, you don't write a font preview tool?";

    m_fonts.append(qApp->font().family());
}

//int FontListModel::rowCount(const QModelIndex &parent) const
//{
//    return m_fonts.size();
//}

//QVariant FontListModel::data(const QModelIndex &index, int role) const
//{
//    switch (role) {
//    case TitleRole:
//        return m_title;
//    case ContentCNRole:
//        return m_contentCn;
//    case ContentENRole:
//        return m_contentEn;
//    case ContentFontRole:
//        return m_fonts.at(index.row());
//    case Qt::SizeHintRole:
//        return QSize(320, 80);
//    default:
//        break;
//    }
//    return QVariant();
//}

void FontListModel::appendFamily(const QString &family)
{
    m_fonts.append(family);

    emit layoutChanged();
}
